Release 10.1A: OpenEdge Development:
Programming Interfaces
Instantiating the control
The AppBuilder generates the code to instantiate the ActiveX control starting with a call to the
enable_UIprocedure from the Main Block:
The programmer has added the comments and code that immediately follow the call to
enable_UI. Here, they must set max-records to the number of records in the query only after the query is opened (again, inenable_UI), but before the spin button control is available to scan the result. The reason for this becomes clearer in later code fragments.The following reduction of the
enable_UIprocedure shows that the AppBuilder generates the code to load the ActiveX control (RUN control_load) before its static parent frame and family of 4GL widgets are displayed and enabled. The initial value ofRecord_Countis also set at control load time (see the "Initializing the control" section. Note also that the application query is opened to obtain the data for the frame:
Note: You can view this code in the Procedures section of the AppBuilder Section Editor. However, unlike the Main Block, this is protected AppBuilder-generated code that you cannot change.
The
control_loadprocedure, called fromenable_UI, is an AppBuilder-generated procedure that loads the ActiveX control into the control-frame by executing theLoadControls( )method of the control-frame COM object. Note the call to initialize-controls, an optional internal procedure that you can define (and which is defined in this example) to modify control properties before the control becomes visible:
Notes: You can view but not change this AppBuilder-generated code from the Section Editor.
You might wonder why you cannot load the control with a chained handle referenceCtrlFrame:COM-HANDLE:LoadControls( ... ). The reason is that even thoughCtrlFrame:COM-HANDLEreturns a component handle, it does so with reference to a widget attribute (COM-HANDLE), not a COM object property or method. You cannot make a component handle expression by chaining widget handle references (that return component handles) with component handle references.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |